package Controller;

import java.util.List;

import mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pojo.User;


@RestController
public class UserController {

    @Autowired
    UserMapper userMapper;

    /**
     * index
     *
     * @return
     */
    @RequestMapping("/db")
    public String index() {
        return "User Info By Mybaties";
    }

    @RequestMapping("/user/listAllUsers")
    public Object allUsers() {
        List<User> users = userMapper.findList();
        return users;
    }

}